open-with-dialog: remove automatic setting of support-for-type
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 22 Nov 2010 22:04:00 +0000 (23:04 +0100)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 23 Nov 2010 15:53:22 +0000 (16:53 +0100)
We don't want to hardcode any kind of policy in these widgets/dialogs from
now on.

gtk/gtkopenwithdialog.c

index 12d93b341a024ca65e538dd7f9606a4a330df5be..04b582726b54132fc0c449c5f638ea74315e1171 100644 (file)
@@ -187,55 +187,6 @@ check_application (GtkOpenWithDialog *self,
   return retval;
 }
 
-static void
-add_or_find_application (GtkOpenWithDialog *self)
-{
-  GAppInfo *app;
-  GList *applications;
-
-  app = gtk_open_with_get_app_info (GTK_OPEN_WITH (self));
-  
-  if (app == NULL)
-    {
-      /* TODO: better error? */
-      show_error_dialog (_("Could not add application"),
-                        NULL,
-                        GTK_WINDOW (self));
-      return;
-    }
-
-  applications = g_app_info_get_all_for_type (self->priv->content_type);
-  if (self->priv->content_type != NULL && applications != NULL)
-    {
-      /* we don't care about reporting errors here */
-      g_app_info_add_supports_type (app,
-                                   self->priv->content_type,
-                                   NULL);
-    }
-
-  if (applications != NULL)
-    g_list_free_full (applications, g_object_unref);
-
-  g_object_unref (app);
-}
-
-static void
-gtk_open_with_dialog_response (GtkDialog *dialog,
-                              gint response_id,
-                              gpointer user_data)
-{
-  GtkOpenWithDialog *self = GTK_OPEN_WITH_DIALOG (dialog);
-
-  switch (response_id)
-    {
-    case GTK_RESPONSE_OK:
-      add_or_find_application (self);
-      break;
-    default :
-      break;
-    }
-}
-
 static void
 widget_application_selected_cb (GtkOpenWithWidget *widget,
                                GAppInfo *app_info,
@@ -537,12 +488,6 @@ gtk_open_with_dialog_init (GtkOpenWithDialog *self)
 {
   self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GTK_TYPE_OPEN_WITH_DIALOG,
                                            GtkOpenWithDialogPrivate);
-
-  /* we can't override the class signal handler here, as it's a RUN_LAST;
-   * we want our signal handler instead to be executed before any user code.
-   */
-  g_signal_connect (self, "response",
-                   G_CALLBACK (gtk_open_with_dialog_response), NULL);
 }
 
 static void